]> git.r.bdr.sh - rbdr/captura/blame_incremental - Captura/Core Extensions/NSScreen+screenWithMouse.swift
Save WIP -> Multimonitor change working
[rbdr/captura] / Captura / Core Extensions / NSScreen+screenWithMouse.swift
... / ...
CommitLineData
1import Cocoa
2
3extension NSScreen {
4 static var screenWithMouse: NSScreen? {
5 let mouseLocation = NSEvent.mouseLocation
6 for screen in NSScreen.screens {
7 if NSMouseInRect(mouseLocation, screen.frame, false) {
8 return screen
9 }
10 }
11 return NSScreen.main
12 }
13}